package com.das.cloudmetro.ssoserver.feign;

import feign.hystrix.*;
import org.springframework.stereotype.*;
import com.liy.framework.common.extvo.*;
import org.slf4j.*;

@Component
public class AuthorizationFeignClientFallbackFactory implements FallbackFactory<AuthorizationFeignClient>
{
    private static final Logger log;
    
    public AuthorizationFeignClient create(final Throwable e) {
        AuthorizationFeignClientFallbackFactory.log.info("sys feign fallback; reason was: {}", (Object)e.getMessage());
        return new AuthorizationFeignClient() {
            @Override
            public ResultVO authorization(final String token) {
                return this.defaultResultVO();
            }
            
            @Override
            public ResultVO hasPermission(final String token, final String code) {
                return this.defaultResultVO();
            }
            
            @Override
            public ResultVO getUserPublicKey(final String clientId, final String secret) {
                return this.defaultResultVO();
            }
            
            @Override
            public ResultVO permissionSync(final Object obj) {
                return this.defaultResultVO();
            }
            
            private ResultVO defaultResultVO() {
                return new ResultVO(false, "\u8ba4\u8bc1\u670d\u52a1\u5f02\u5e38: " + e.getMessage(), "500");
            }
        };
    }
    
    static {
        log = LoggerFactory.getLogger((Class)AuthorizationFeignClientFallbackFactory.class);
    }
}
